<?php
/*
 * @Author: your name
 * @Date: 2020-12-23 12:01:16
 * @LastEditTime: 2020-12-28 10:20:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /special/application/common/service/HostView.php
 */

namespace app\common\service;


use think\Db;

class HostView extends BaseService
{
    /**
     * @name: 端口访问量曲线图
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-06-04 14:00:16
     */
    public function topPort()
    {
        $return = Db::name('HostView')->field('ym, number')->order('id', 'DESC')->limit($this->getPageLimit())->select();

        foreach($return as $k => $v)
        {
            $d_str = substr($v['ym'], -2);
            $return[$k]['ym'] = str_replace($d_str, '/' . $d_str, $v['ym']) ;
        }

        return array_reverse($return, false);
    }
}